/*
 * Copyright 2008 Stuart Moffatt stuartmoffatt@gmail.com
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package com.googlecode.emcode.rvha.client.ui;

import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class TechnologicalHazards extends Composite {

	private SimplePanel panel;
	private VerticalPanel list;
	
	private CheckBox storageTanks;
	private CheckBox damFailure;
	private CheckBox toxicRelease;
	
	public TechnologicalHazards()
	{
	    panel = new SimplePanel();
	    list = new VerticalPanel();
	    panel.setWidget(list);
	    
	    storageTanks = new CheckBox("Leaking underground storage tanks");
	    storageTanks.addClickListener(new ClickListener() {
	        public void onClick(Widget sender) {
	        	CheckBox cb = (CheckBox) sender;
                MainLayout.get().toggleKml(MainLayout.KML_TANKS, cb);
	        }
	    });
	    storageTanks.setStyleName("rvha-Hazards");
	    
	    damFailure = new CheckBox("Dam failure");
	    damFailure.addClickListener(new ClickListener() {
	        public void onClick(Widget sender) {
	        	CheckBox cb = (CheckBox) sender;
                MainLayout.get().toggleKml(MainLayout.KML_DAM, cb);
	        }
	    });
	    damFailure.setStyleName("rvha-Hazards");
	    
	    toxicRelease = new CheckBox("Toxic release sites");
	    toxicRelease.addClickListener(new ClickListener() {
	        public void onClick(Widget sender) {
	        	CheckBox cb = (CheckBox) sender;
                MainLayout.get().toggleKml(MainLayout.KML_TOXIC, cb);
	        }
	    });
	    toxicRelease.setStyleName("rvha-Hazards");
	    
	    list.add(storageTanks);
	    list.add(damFailure);
	    list.add(toxicRelease);
	    
	    initWidget(panel);
	    setStyleName("rvha-Hazards"); // was mail-Tasks
	    
	}
}
